Dynamic Programming: Water Allocation Problem